#include <iostream>
#include <cmath> 
#define PI 3.1415926
using namespace std;

class shape {// 形状类
public:
 double getArea()  // 求面积
 {return -1;}
 double getPerimeter() // 求周长
 {return -1;}
};


class RegularPolygon:public shape
{
    private:
        int n;
        double a;
    public:
        RegularPolygon(int p,double s){n=p;a=s;}
        double getArea () const{return n*a*a/(tan(1.0/n*PI)*4);}
        double getPerimeter() const{return n*a;}
};


int main()
{
    int n; 
    double s;

    cin>>n>>s;
    RegularPolygon p(n,s);
    cout<<p.getArea()<<endl;

    cout<<p.getPerimeter()<<endl;

    return 0;
}